home *** CD-ROM | disk | FTP | other *** search
- unit ClientForm3U;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls, CorbaObj;
-
- type
- TForm1 = class(TForm)
- Timer1: TTimer;
- Label1: TLabel;
- procedure FormCreate(Sender: TObject);
- procedure Timer1Timer(Sender: TObject);
- public
- Server: TAny;
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.FormCreate(Sender: TObject);
- var
- Factory: TAny;
- begin
- Factory := CorbaBind('IDL:Server/TestFactory:1.0');
- Server := Factory.CreateInstance('');
- Timer1.Enabled := True
- end;
-
- procedure TForm1.Timer1Timer(Sender: TObject);
- begin
- try
- Label1.Caption := DateTimeToStr(Server.Get_DateAndTime)
- except
- on E: Exception do
- begin
- Timer1.Enabled := False;
- Label1.Caption := Format('Server not available (an %s exception occurred, saying "%s")', [E.ClassName, E.Message])
- end
- end
- end;
-
- end.
-